package com.company;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Solution {
    public static List<Egg> eggs = new ArrayList<Egg>();
    public static Iterator<Egg> iteratorForEggs;
    public static List<Chicken> chickens = new ArrayList<Chicken>();
    public static Iterator<Chicken> iteratorForChicken;
    public static int countOutChicken = 0;

    public static class Egg{
        private int day;

        public Egg(int day){
            this.day = day;
            eggs.add(this);
        }

        public void dayByDay(int day){
            if(this.day + 10 == day){
                iteratorForEggs.remove();
                new Chicken(day);
            }
        }
    }

    public static class Chicken{
        private int day;

        public Chicken(int day){
            this.day = day;
            chickens.add(this);
        }

        public void dayByDay(int day){
            int old = day - this.day;
            if(old >= 30 && old < 60){
                if((old-30)%3==0){
                    new Egg(day);
                }
            }else if(old >= 60 && old < 90){
                if((old-60)%2 == 0){
                    new Egg(day);
                }
            }else if(old >= 90 && old < 120){
                new Egg(day);
            }else if(old >=120){
                iteratorForChicken.remove();
                countOutChicken++;
            }
        }
    }

    public static void main(String[] args) {
        int n = Integer.valueOf(args[0]);

        new Egg(1);

        for(int i = 1; i <= n; i++){
            for(iteratorForEggs = eggs.iterator(); iteratorForEggs.hasNext();){
                Egg egg = iteratorForEggs.next();
                egg.dayByDay(i);
            }

            for(iteratorForChicken = chickens.iterator(); iteratorForChicken.hasNext();){
                Chicken chicken = iteratorForChicken.next();
                chicken.dayByDay(i);
            }
        }

        System.out.printf("%d %d %d", eggs.size(), chickens.size(), countOutChicken);
    }
}

